﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace DeltaPlcSystem
{
    public partial class IntervalForm : Form
    {
        public delegate void IntervalDele(string startTime,string endTime);
        public event IntervalDele IntervalEvent;
        public IntervalForm()
        {
            InitializeComponent();
            MaximizeBox = false;
           
                //this.Text = "PQM链接更新";
                //uiTextBox1.Text = Form1.PQMserverURL;
          


        }



        private void uiButton1_Click(object sender, EventArgs e)
        {
            try
            {

                DateTime d2= Convert.ToDateTime(uiDatetimePicker2.Text);
                DateTime d1 = Convert.ToDateTime(uiDatetimePicker1.Text);

                if (d2 > d1)
                {
                    IntervalEvent(uiDatetimePicker1.Text, uiDatetimePicker2.Text);


                    MessageBox.Show("更新成功");

                    this.Close();
                }
                else
                {
                    MessageBox.Show("结束时间大于等于开始时间，请重新选择!");
                }               
            }
            catch { }   
        }

     
    }
}
